﻿using RAP.Framework.Libary.Utils;
using RAP.Framework.Libary.DomTemplateBuilder.Element.Conditional;
using RAP.Framework.Libary.DomTemplateBuilder.Attributes;
using RAP.Framework.Libary.DomTemplateBuilder.Handler;

namespace RAP.Framework.Libary.DomTemplateBuilder.Element
{
	/// <summary>
	/// 引用动态生成的名称的
	/// </summary>
	[TagHandler( typeof( EvalTemplateHandler ) )]
	public class EvalTemplate : ElementBase
	{
		/// <summary>
		/// “否则”分支，如果指定的模板不存在，则执行否则节点的逻辑
		/// </summary>
		public virtual Else Else
		{
			get;
			set;
		}

		/// <summary>
		/// 无Else节点并且模板未找到时是否抛出异常
		/// </summary>
		public bool ThrowError
		{
			get
			{
				return this.ToBoolean ( "ThrowError", true );
			}
		}
	}
}
